Skip to content

fix: resolve PHPStan unreachable code errors in type assertions #56491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

KIKOmanasijev
Copy link
Contributor

This PR fixes PHPStan unreachable code errors in Support/Helpers.php type assertion tests.

Problem

PHPStan was reporting "Unreachable statement - code above always terminates" errors on lines 47 and 66 because throw_if(true, Exception::class) and similar statements always throw an error when the first argument is truthy, causing PHPStan to detect that code following these statements is unreachable.

image

@KIKOmanasijev
Copy link
Contributor Author

This PR and #56488 are going to fix the entire test suite for the master branch.

@crynobone
Copy link
Member

We will merge 12.x to master so this is not required.

@crynobone crynobone closed this Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants